using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ERPBackend.Models
{
    public class Supplier : BaseModel
    {
        [StringLength(50)]
        public string SupplierCode { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string SupplierName { get; set; } = string.Empty;

        [Required]
        [StringLength(100)]
        public string SupplierShortName { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string SupplierType { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string SupplierLevel { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string Address { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string TaxIdentificationNumber { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string BankNameAndAccount { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string InvoiceType { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string InvoicingAddress { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string InvoicingPhone { get; set; } = string.Empty;

        [Required]
        [StringLength(100)]
        public string ContactPerson { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string Phone { get; set; } = string.Empty;



        [StringLength(500)]
        public string? Notes { get; set; }

        public string? Remark { get; set; }

        [Required]
        [Range(0, 1)]
        public byte Status { get; set; } = 1;

        // Navigation property for contacts
        public ICollection<SupplierContact> Contacts { get; set; } = new List<SupplierContact>();

        // Navigation property for qualifications
        public ICollection<SupplierQualification> Qualifications { get; set; } = new List<SupplierQualification>();
    }
}